#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWebEngineView>
#include <QtWebChannel>
#include <QWebSocketServer>
#include <QtWebSockets>

#include "mytestclass.h"
#include "websockettransport.h"


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onNewConnection();
    void onTransportMessageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport);

private:
    void startServer();



    Ui::MainWindow *ui;

    QWebEngineView* m_webEngineView;
    QWebChannel* m_webChannel;

    MyTestClass* m_myTestClass;

    QWebSocketServer* m_websocketServer;

};

#endif // MAINWINDOW_H
